package cn.ccew.sys.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import cn.ccew.common.base.model.BaseEntity;

/**
 * 角色授权
 * 
 * @author lxj
 * 
 */
//@Entity
//@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
//@Table(name = "sys_authorize")
public class SysAuthorize extends BaseEntity {
	/**
	 * 所属用户
	 */
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY)
	@JoinColumn(name = "personnel_id")
	private SysPersonnel personnel;
	/**
	 * 所有资源分配
	 */
	@ManyToOne(cascade = { CascadeType.MERGE, CascadeType.REFRESH }, fetch = FetchType.LAZY)
	@JoinColumn(name = "allocation_id")
	private SysAllocation allocation;

	public SysPersonnel getPersonnel() {
		return personnel;
	}

	public void setPersonnel(SysPersonnel personnel) {
		this.personnel = personnel;
	}

	public SysAllocation getAllocation() {
		return allocation;
	}

	public void setAllocation(SysAllocation allocation) {
		this.allocation = allocation;
	}

}
